package com.chenchao.javacommonclass;

/**
 * @encoding : UTF-8
 * @Time : 2020/11/11 12:37
 * @Author : Chen Chao
 * @File : javaSE.com.chenchao.commonclass.System.java
 * @Software : IntelliJ IDEA
 * @since : 1.8
 */
public class SystemTest {
    public static void main(String[] args) {
        //int[] a={1,2,3,4,5};
        //int[] b=new int[3];
        //java.lang.System.arraycopy(a,0,b,0,3);
        //java.lang.System.out.println(Arrays.toString(a));
        //java.lang.System.out.println(Arrays.toString(b));
        ////[1, 2, 3, 4, 5]
        ////[1, 2, 3]

        long time1= System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            System.out.println(i);
        }
        System.out.println(System.currentTimeMillis()-time1+"ms");
        //10ms

        //System.exit(0);
        ////正常终止，下面代码不执行
        //System.out.println("gg");

        new Gg();
        new Gg();//不会立马回收
        //System.gc();//立马回收
    }
}
class  Gg{
    @Override
    protected void finalize() throws Throwable {
        System.out.println("我挂了");
        super.finalize();
    }
}